package main

import "fmt"

//#link: https://leetcode-cn.com/problems/hamming-distance/
func main() {
	fmt.Println(hammingDistance(1, 2))
}

func hammingDistance(x int, y int) int {
	result := 0
	xor := x ^ y
	for xor > 0 {
		result += xor & 1
		xor >>= 1
	}
	return result
}
